package utils;

import java.io.IOException;
import java.util.Properties;

/**
 * properties文件内容value获取
 *
 * @author 修唯xiuwei
 * @Email 524710549@qq.com
 **/
public class PropertiesReader {

	private static class LazyHolder {
		private static final PropertiesReader INSTANCE = new PropertiesReader();
	}

	private Properties p = new Properties();

	private PropertiesReader() {
		try {
			p.load(PropertiesReader.class.getClassLoader().getResourceAsStream("application.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static final PropertiesReader getInstance() {
		return PropertiesReader.LazyHolder.INSTANCE;
	}


	/**
	 * 读取properties配置文件信息
	 */

	/**
	 * 根据key得到value的值
	 */
	public String getValue(String key) {
		return this.p.getProperty(key);
	}
}
